import request from '@/utils/request';

// 创建员工
export async function createWorker(data = {}) {
  return request('/api/user/create', {
    method: 'POST',
    data
  });
}
export async function getWorkerList(params) {
  return request('/api/user/pageList', {
    method: 'GET',
    params
  });
}
export async function getWorkerInfo(params = {}) {
  return request('/api/user/info/' + params.id, {
    method: 'GET'
  });
}
export async function getUserInfo(params = {}) {
  return request('/api/user/info', {
    method: 'GET'
  });
}
export async function getTenantInfo(params = {}) {
  return request('/api/tenant/info', {
    method: 'GET'
  });
}
export async function changePwd(data = {}) {
  return request('/api/user/changePwd', {
    method: 'POST',
    data
  });
}
export async function addSettlement(data = {} ) {
  return request('/api/tenant/createPay', {
    method: 'POST',
    data
  });
}
export async function getSettlementList(params = {}) {
  return request('/api/tenant/payList', {
    method: 'GET',
    params
  });
}

export async function getDayStatistics(params = {}) {
  return request('/api/tenant/dayList', {
    method: 'GET',
    params
  });
}
// getMonthStatistics
export async function getMonthStatistics(params = {}) {
  return request('/api/tenant/monthList', {
    method: 'GET',
    params
  });
}
export async function createRecord(data = {}) {
  return request('/api/user/createRecord', {
    method: 'POST',
    data
  });
}
export async function createPay(data = {}) {
  return request('/api/user/createPay', {
    method: 'POST',
    data
  });
}
export async function getWorkerRecordList(params) {
  return request('/api/user/recordList', {
    method: 'GET',
    params
  });
}
export async function updateWorker(data) {
  return request('/api/user/update/'+ data.userId, {
    method: 'POST',
    data
  });
}